home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
BASIC
/
0007.ZIP
/
DHDEMO.BAS
< prev
next >
Wrap
BASIC Source File
|
1984-01-02
|
2KB
|
61 lines
10 'THIS PROGRAM DEMONSTRATES DISK HANDLER
20 'FROM THE OCTOBER ISSUE OF SOFTALK, P. 72.
30 'WRITTEN BY HOWARD GLOSSER
40 'DEFINE SEGMENT AND LOAD DISKHAND.BIN
50 'CLEAR,32768 ' THIS LINE IS NECESSARY ONLY FOR 64K MACHINES.
60 DEF SEG=&H1700 ' USE DEF SEG=&HF00 WITH MACHINES WITH LESS THEN 96K.
70 BLOAD "DISKHAND.BIN",0
80 DISK%=0
90 CLS
100 LOCATE 1,5:PRINT" ** DISK HANDLER DEMONSTRATION **":PRINT
110 '
120 'FIND DEFAULT DRIVE
130 '
140 FIND%=1:SET%=2:DISKPARM$=SPACE$(1)
150 PRINT"FIND THE DEFAULT DRIVE"
160 DISKOPT%=FIND%
170 PRINT"*** SUBROUTINE CALL"
180 CALL DISK% (DISKOPT%,DISKPARM$):SAVDRV$=DISKPARM$
190 PRINT"GOT BACK AND DEFAULT DRIVE IS "CHR$(34)DISKPARM$ CHR$(34)
200 PRINT
210 '
220 'SET DEFAULT DRIVE
230 '
240 PRINT"NOW LET'S SET A NEW DEFAULT DRIVE":LOCATE ,,1:BEEP:PRINT
250 PRINT"SPECIFY NEW DEFAULT DRIVE LETTER (A B C D:";:GOSUB 460
260 DISKPARM$=KY$:DISKOPT%=SET%
270 PRINT"*** SUBROUTINE CALL"
280 CALL DISK% (DISKOPT%,DISKPARM$)
290 PRINT"RETURN FROM SUBROUTINE AND NEW DEFAULT SHOULD BE SET"
300 '
310 ' ** FIND OUT IF IT REALLY CHANGED
320 '
330 PRINT
340 PRINT"FIND OUT IF DEFAULT DRIVE REALLY CHANGED"
350 DISKOPT%=FIND%
360 PRINT"*** SUBROUTINE CALL"
370 CALL DISK% (DISKOPT%,DISKPARM$)
380 IF DISKPARM$<>SAVDRV$ THEN 420
390 SOUND 50,7:COLOR 0,7
400 PRINT"DEFAULT DRIVE NOT CHANGED. INVALID OR SAME DRIVE LETTER SPECIFIED!"
410 COLOR 6,1:GOTO 440
420 PRINT"IT'S CHANGED! THE DEFAULT DRIVE IS NOW "CHR$(34)DISKPARM$ CHR$(34)
430 SOUND 500,1:SOUND 400,1
440 END
450 '
460 ' **** KEY-IN ROUTINE
470 '
480 KY$=INKEY$:IF KY$="" THEN 480
490 '
500 ' CHECK FOR SMALL OR CAPITAL LETTERS
510 '
520 IF KY$<CHR$(97) OR KY$>CHR$(122) THEN 570
530 '
540 ' ** CHANGE LOWERCASE TO UPPERCASE
550 '
560 KY$=CHR$(ASC(KY$)-32)
570 '
580 PRINT KY$
590 RETURN
600 END' OF PROGRAM.